<template>
    <section>
        <input type="text" placeholder="请输入任务名称" v-model="inputText"> <span @click="add">新增</span><br>
    </section>
</template>

<script setup>
  import { ref } from 'vue';
  import { userenwuStore} from '../stores/renwu'
  import { useRoute } from 'vue-router'
var inputText =ref('')

var store =userenwuStore()

var $route = useRoute();

//新增任务
var add = ()=>{

store.xinzeng(inputText.value);//调用仓库中的方法addTask,新增任务

inputText.value = '';

}

</script>

<style scoped>
button {
  margin-top: 10px;
}
</style>